package com.tianheng.wanzhou.datacollecting.netty.kongyajiR150.receiver;

import com.tianheng.wanzhou.datacollecting.netty.kongyajiR150.receiver.receiverImpl.Air1Receiver;
import com.tianheng.wanzhou.datacollecting.netty.kongyajiR150.receiver.receiverImpl.Air2Receiver;
import com.tianheng.wanzhou.datacollecting.netty.kongyajiR150.receiver.receiverImpl.Air3Receiver;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author: yujw
 * @Date: 2020/5/16 15:50
 * @Version 1.0
 */
@Component("kongyajiR150ReceiveFactory")
public class ReceiverFactory {

    @Autowired
    Air1Receiver air1Receiver;
    @Autowired
    Air2Receiver air2Receiver;
    @Autowired
    Air3Receiver air3Receiver;


    public Receiver getReceiver(String type) {
        Receiver receiver = null;
        if (type.equals("0101")) {
            receiver = this.air1Receiver;
        }
        if (type.equals("0102")) {
            receiver = this.air2Receiver;
        }
        if (type.equals("0103")) {
            receiver = this.air3Receiver;
        }
        return receiver;
    }
}
